package inner;

interface MyInterface {

    void fn();
}

public class AnonymousInnerClassDemo {

    AnonymousInnerClassDemo() {
        System.out.println("AnonymousInnerClassDemo的构造方法..");
    }

    public static void main(String[] args) {


        MyInterface inter = new MyInterface() {
            @Override
            public void fn() {
                System.out.println("我实现了fn()...");
            }
        };

        inter.fn();

        MyInterface inter2 = ()->System.out.println("我也实现了fn()...");
        inter2.fn();
    }
}
